number of good pairs leetcode python